using System;
using System.IO;
using System.Xml.Serialization;

namespace MH.WsdlWorks.ProjectModel
{
    public abstract class Node : INode
    {
        INode parent;
        [XmlIgnore]
        public INode Parent
        {
            get { return parent; }
            set { parent = value; }
        }

        string name;
        [XmlAttribute]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public Node() { }
        public Node(INode parent, string name)
        {
            this.parent = parent;
            this.name = name;
        }

        public string GetPath()
        {
            return Path.Combine(parent.GetPath(), this.name);
        }

        public abstract void SetParent(INode parent);
    }
}
